var mourseMoveObject =
{
	isCanSelect:false,	//表示创建表单，鼠标进入 form中 可以选中 元素
	isMourseDown:false,
	xxsource:0,
	yysource:0,
	is_in_rec:function (x0,y0,x1,y1,a0,b0,a1,b1){
	var c0 = Math.max(x0,a0);
	var c1 = Math.min(x1,a1);
	var t0 = Math.max(y0,b0);
	var t1 = Math.min(y1,b1);
	if(c0>c1||t0>t1){
		return false;
	}
	else return true;
	}
};


            /*
             DragResize v1.0
             (c) 2005-2006 Angus Turnbull, TwinHelix Designs http://www.twinhelix.com
             Licensed under the CC-GNU LGPL, version 2.1 or later:
             http://creativecommons.org/licenses/LGPL/2.1/
             This is distributed WITHOUT ANY WARRANTY; without even the implied
             warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
             */
            if (typeof addEvent != 'function') {
                var addEvent = function(o, t, f, l){
                    var d = 'addEventListener', n = 'on' + t, rO = o, rT = t, rF = f, rL = l;
                    if (o[d] && !l) 
                        return o[d](t, f, false);
                    if (!o._evts) 
                        o._evts = {};
                    if (!o._evts[t]) {
                        o._evts[t] = o[n] ? {
                            b: o[n]
                        } : {};
                        o[n] = new Function('e', 'var r=true,o=this,a=o._evts["' + t + '"],i;for(i in a){o._f=a[i];r=o._f(e||window.event)!=false&&r;o._f=null}return r');
                        if (t != 'unload') 
                            addEvent(window, 'unload', function(){
                                removeEvent(rO, rT, rF, rL);
                            });
                    }
                    if (!f._i) 
                        f._i = addEvent._i++;
                    o._evts[t][f._i] = f;
                };
                addEvent._i = 1;
                var removeEvent = function(o, t, f, l){
                    var d = 'removeEventListener';
                    if (o[d] && !l) 
                        return o[d](t, f, false);
                    if (o._evts && o._evts[t] && f._i) 
                        delete o._evts[t][f._i];
                };
            }
            function cancelEvent(e, c){
                e.returnValue = false;
                if (e.preventDefault) 
                    e.preventDefault();
                if (c) {
                    e.cancelBubble = true;
                    if (e.stopPropagation) 
                        e.stopPropagation();
                }
            };
            function DragResize(myName, config){
                var props = {
                    myName: myName,
                    enabled: true,
                    handles: ['tl', 'tm', 'tr', 'ml', 'mr', 'bl', 'bm', 'br'],
                    isElement: null,
                    isHandle: null,
                    element: null,
                    handle: null,
                    minWidth: 10,
                    minHeight: 10,
                    minLeft: 0,
                    maxLeft: 9999,
                    minTop: 0,
                    maxTop: 9999,
                    zIndex: 1,
                    mouseX: 0,
                    mouseY: 0,
                    lastMouseX: 0,
                    lastMouseY: 0,
                    mOffX: 0,
                    mOffY: 0,
                    elmX: 0,
                    elmY: 0,
                    elmW: 0,
                    elmH: 0,
					isoncfz:false,
                    allowBlur: true,
                    ondragfocus: null,
                    ondragstart: null,
                    ondragmove: null,
                    ondragend: null,
                    ondragblur: null
                };
                for (var p in props) 
                    this[p] = (typeof config[p] == 'undefined') ? props[p] : config[p];
            };
            DragResize.prototype.apply = function(node){
                var obj = this;
                addEvent(node, 'mousedown', function(e){
                    obj.mouseDown(e);
                });
                addEvent(node, 'mousemove', function(e){
                    obj.mouseMove(e);
                });
                addEvent(node, 'mouseup', function(e){
                    obj.mouseUp(e);
                });
                addEvent(node,'keyup',function(e){
                	obj.keyUp(e);
                });
            };
            DragResize.prototype.select = function(newElement,b,e){
                with (this) {
                    if (!document.getElementById || !enabled) 
                        return;
                    if (newElement && (newElement != element) && enabled) {
                        element = newElement;
                        var i_type = ($("#"+element.id).attr("i_type"));
                        var userType = eval("this.now_Object.allItemProperty.useType."+i_type);
                        var i_id = element.id;
                        if(e.ctrlKey){ //按住ctrl键多选
                        	var k = 0;
            	        	var tempelement;
	        	        	switch(userType)
	        	        	{
		        	        	case "ceateDivinput":
		        	        	case "ceateDivtextarea":
		                			tempelement = document.getElementById(element.id+"_handle_id_cfz");
		                			break;
		                		default:break;
	        	       	 	}
	        	        	for(k;k<this.now_Object.mulSelectItemId.length;k++)
	        	        	{
	        	        		var myObject = document.getElementById(this.now_Object.mulSelectItemId[k]);
	        	        		if(myObject==element||tempelement==myObject)  break;
	        	        	}
	        	        	if(k==this.now_Object.mulSelectItemId.length)
	        	        	{
	        	        		switch(userType)
		        	        	{
			        	        	case "ceateDivinput":
			        	        	case "ceateDivtextarea":
			                			element = this.now_Object.componentToDiv(element,i_type);
			                			break;
			                		default:break;
		        	       	 	}
	        	               // if(isTypeInTypearray(itemtype,hasItemsItemType))//表示是radio和checkbox类型
	        	               // {
	        	        		//	$("#" + element.id+" div").attr("style","");
	        	        		//}
	        	        		this.now_Object.mulSelectItemId.push(element.id);
	        	               // resizeHandleSet = false;
	        	        	}  //功能不明确
	        	        	
	        	        	else 	
	        	        	{
	        	        		switch(userType)
		        	        	{
			        	        	case "ceateDivinput":
			        	        	case "ceateDivtextarea":
			                			element = tempelement;
			                			break;
			                		default:break;
		        	       	 	}
	        	        		//resizeHandleSet = false;
	        	       	 	}
	        	        	this.now_Object.selectAndModifyComponent();
                        }else
                        {
                        	if(!mourseMoveObject.isMourseDown)
            	        	{
                        		this.now_Object.mulSelectItemId = [];
                        		if(this.now_Object.linstenersFlag.beforeSelectOneFlag==true)
                        			this.now_Object.linsteners.beforeSelectOne(element,i_id,i_type,userType);
            	        	}
	                        switch(userType)
	                        {
		                        case "ceateDivinput":
		        	        	case "ceateDivtextarea":
		                			if(element.id.indexOf("_handle_id_cfz")==-1)
		                				element = this.now_Object.componentToDiv(element,i_type);
		                			break;
		                		default:
		                			break;
	                        }
	                        this.now_Object.mulSelectItemId.push(element.id);
	                        this.now_Object.selectAndModifyComponent();
                        }
                        element.style.zIndex = ++zIndex;
                        if (this.resizeHandleSet) 
                            this.resizeHandleSet(element, true);
                        elmX = parseInt(element.style.left);
                        elmY = parseInt(element.style.top);
                        elmW = element.offsetWidth;
                        elmH = element.offsetHeight;
                        if(!mourseMoveObject.isMourseDown)//afterSelectOne事件  选中一个
                        {
                        	if(this.now_Object.linstenersFlag.afterSelectOneFlag == true)
                        		this.now_Object.linsteners.afterSelectOne(element,i_id,i_type,userType);
                        }
                        if (ondragfocus) 
                            this.ondragfocus();
                    }
                }
            };
            DragResize.prototype.deselect = function(delHandles,e){
                with (this) {
                	
                	var event_flag = false;
                    if (!document.getElementById || !enabled) 
                        return;
                    if (delHandles) {
                        if (ondragblur) 
                            this.ondragblur();
                        if(e==undefined)
                        {
                        	event_flag = true;
                        }
                        else 
                        {
            				if(!e.ctrlKey)
            					event_flag = true;
            			}
                        if(event_flag&&this.resizeHandleSet&&mourseMoveObject.isCanSelect)
                        {   
                        	for(var j=0;j<this.now_Object.mulSelectItemId.length;j++)
                        	{
                        		this.resizeHandleSet(document.getElementById(this.now_Object.mulSelectItemId[j]), false);
                        		var i_type = $("#"+this.now_Object.mulSelectItemId[j]).attr("i_type");
                        		var useType = eval("this.now_Object.allItemProperty.useType."+i_type);
                        		switch(useType)
                        		{
	                        		case "ceateDivinput":
			        	        	case "ceateDivtextarea":
	 		                			if(this.now_Object.mulSelectItemId[j].indexOf("_handle_id_cfz")>-1)
	 		                			{
	 		                				var input_id_cfz = this.now_Object.mulSelectItemId[j].substring(0,this.now_Object.mulSelectItemId[j].length-14);
	 		                				var div_id_cfz1 = this.now_Object.mulSelectItemId[j];
	 		                				var div_id_cfz = "#"+div_id_cfz1;
	 		                				$(div_id_cfz).after($("#"+input_id_cfz));
		 		       						$("#"+input_id_cfz).addClass('x-abs-layout-item');
		 		       						$("#"+input_id_cfz).addClass('drsElement');
		 		       						$("#"+input_id_cfz).attr("style",$(div_id_cfz).attr("style"));
				 		       				for(var tt in eval("this.now_Object.allTypeItem."+i_type))
				 		       				{
				 		       					if(tt=="i_id") continue;
				 		       					$("#"+input_id_cfz).attr(tt,$(div_id_cfz).attr(tt));
				 		       					//if(tt=="i_id"||tt=="style") continue;
				 		       					//$("#" + i_id).attr(tt, (eval("this.allTypeItem."+i_type))[tt]);
				 		       				}
				 		       				$(div_id_cfz).remove();
	 		                			}
	 		                		break;
	 		                		default:
	 		                		break;
                        		}
                        	}
                        	this.now_Object.mulSelectItemId = [];
                            //this.resizeHandleSet(element, false);
                            //element = null
                        	var  formId_Tab_no = "_newform_id";
                        	if(this.now_Object.useFormTab.flag)
                        		formId_Tab_no = (Ext.getCmp("TabsPanel_cfz_pp").getActiveTab().get(0).getId());
                        	Ext.getCmp("propsGrid_cfz").setTitle('表单属性');
                        	Ext.getCmp("propsGrid_cfz").setSource({
            				    '表单名称': Ext.getCmp(formId_Tab_no).title,
            				    '表单高度': Ext.getCmp(formId_Tab_no).height,
            				    '表单宽度': Ext.getCmp(formId_Tab_no).width,
            				    'tab顺序方式':Ext.getCmp(formId_Tab_no).tabSelectValue_
            			    });
                        }
                        if(mourseMoveObject.isCanSelect)
            	        {
            	        	element = null;
            	        }
                    }
                    handle = null;
                    mOffX = 0;
                    mOffY = 0;
                }
            };

            DragResize.prototype.keyUp = function(e){
            	if(e.keyCode==13&&this.now_Object.isModifyLabel.flag)//回车双击lable取消 输入框
            	{
            		var bb = $("#label_text_id").attr("value");
                	var temp = ($("#"+this.now_Object.isModifyLabel.labelId).children("div"));
                	bb = bb.replace(/\s/ig,"&nbsp;");
        			$("#"+this.now_Object.isModifyLabel.labelId).html(bb);
        			$("#"+this.now_Object.isModifyLabel.labelId).attr("i_value",bb);
        			temp.appendTo("#"+this.now_Object.isModifyLabel.labelId);
        			$("#"+this.now_Object.isModifyLabel.labelId).show();
        			$("#label_text_id").remove();
        			this.now_Object.isModifyLabel.labelId =null;
        			this.now_Object.isModifyLabel.flag = false;
            	}
            	return ;
            	
            };
            DragResize.prototype.mouseDown = function(e){
            	if(e.button ==2){
            		return false;
            	}
            	if(!mourseMoveObject.isCanSelect) return;
                with (this) {
					
                    if (!document.getElementById || !enabled) 
                        return true;
                    var elm = e.target || e.srcElement, newElement = null, newHandle = null, hRE = new RegExp(myName + '-([trmbl]{2})', '');
                    while (elm) {
                        if (elm.className) {
                            if (!newHandle && (hRE.test(elm.className) || isHandle(elm))) 
                                newHandle = elm;
                            if (isElement(elm)) {
                                newElement = elm;
                                break;
                            }
                        }
                        elm = elm.parentNode;
                    }
                    if(this.now_Object.isModifyLabel.flag)//双击lable取消 输入框
                    {
                    	var bb = $("#label_text_id").attr("value");
                    	var temp = ($("#"+this.now_Object.isModifyLabel.labelId).children("div"));
                    	bb = bb.replace(/\s/ig,"&nbsp;");
            			$("#"+this.now_Object.isModifyLabel.labelId).html(bb);
            			$("#"+this.now_Object.isModifyLabel.labelId).attr("i_value",bb);
            			temp.appendTo("#"+this.now_Object.isModifyLabel.labelId);
            			$("#"+this.now_Object.isModifyLabel.labelId).show();
            			$("#label_text_id").remove();
            			this.now_Object.isModifyLabel.labelId =null;
            			this.now_Object.isModifyLabel.flag = false;
                    }

                    if (element && (element != newElement) && allowBlur) 
                    {
                    	var k;
            	    	for(k=0;k<this.now_Object.mulSelectItemId.length;k++)
            	    	{
            	    		var elementobj = document.getElementById(this.now_Object.mulSelectItemId[k]);
            	    		if(newElement==elementobj)
            	    			break;
            	    	}
            	    	if(k==this.now_Object.mulSelectItemId.length)  deselect(true,e);
            	    	else
            	    	{
            		    	element = newElement;
            		    	elmW = element.offsetWidth;
            		        elmH = element.offsetHeight;
            		        elmX = parseInt(element.style.left);
            		        elmY = parseInt(element.style.top);
            	        }
                    }
                       // deselect(true);
					
                    if (newElement && (!element || (newElement == element))) {
                        if (newHandle) 
                            cancelEvent(e);
                        select(newElement, newHandle,e);
                        handle = newHandle;
                        if (handle && ondragstart) 
                            this.ondragstart(hRE.test(handle.className));
                    }
					else{
						//说明点击的是空白地方。
						mourseMoveObject.isMourseDown = true;
						//记录点击的第一地方位置
						mourseMoveObject.xxsource = e.pageX || e.clientX + document.documentElement.scrollLeft;
						mourseMoveObject.yysource = e.pageY || e.clientY + document.documentElement.scrollTop;
						//添加一个div标签。显示用的
						$("body").append("<div id='aaaaaa' style='position:absolute;border:1px solid blue;'></div>"); 
						div_cfz =  $("#aaaaaa");
						div_cfz.css("left",mourseMoveObject.xxsource);
						div_cfz.css("top",mourseMoveObject.yysource);
					}
                }
            };
		
            DragResize.prototype.mouseMove = function(e){
				if(mourseMoveObject.isMourseDown){//如果是点击空白地方，说明是选择作用不是移动作用。
					var xx_mouse = e.pageX || e.clientX + document.documentElement.scrollLeft;
					var yy_mouse = e.pageY || e.clientY + document.documentElement.scrollTop;
					var www = Math.abs(xx_mouse  - mourseMoveObject.xxsource);
					var hhh = Math.abs(yy_mouse - mourseMoveObject.yysource);
					//如果是向上拖动，要改变left和top属性。
					if(mourseMoveObject.xxsource>xx_mouse) div_cfz.css("left",xx_mouse);
					if(mourseMoveObject.yysource>yy_mouse) div_cfz.css("top",yy_mouse);
					div_cfz.css("width",www);
					div_cfz.css("height",hhh);
					return;
				}
                with (this) {
                    if (!document.getElementById || !enabled) 
                        return true;
                    mouseX = e.pageX || e.clientX + document.documentElement.scrollLeft;
                    mouseY = e.pageY || e.clientY + document.documentElement.scrollTop;
                    var diffX = mouseX - lastMouseX + mOffX;
                    var diffY = mouseY - lastMouseY + mOffY;
                    mOffX = mOffY = 0;
                    lastMouseX = mouseX;
                    lastMouseY = mouseY;
                    if (!handle) 
                        return true;
                    var isResize = false;
                    if (this.resizeHandleDrag && this.resizeHandleDrag(diffX, diffY)) {
                        isResize = true;
                    }
                    else {
                        var dX = diffX, dY = diffY;
                        if (elmX + dX < minLeft) 
                            mOffX = (dX - (diffX = minLeft - elmX));
                        else 
                            if (elmX + elmW + dX > maxLeft) 
                                mOffX = (dX - (diffX = maxLeft - elmX - elmW));
                        if (elmY + dY < minTop) 
                            mOffY = (dY - (diffY = minTop - elmY));
                        else 
                            if (elmY + elmH + dY > maxTop) 
                                mOffY = (dY - (diffY = maxTop - elmY - elmH));
                        elmX += diffX;
                        elmY += diffY;
                        if(elmX<=0) elmX = 0;
            	        if(elmY<=0) elmY = 0;
            	        var k;
            	    	for(k=0;k<this.now_Object.mulSelectItemId.length;k++)
            	    	{
            	    		if(document.getElementById(this.now_Object.mulSelectItemId[k])==element) continue;
            	    		var i_type = $("#"+this.now_Object.mulSelectItemId[k]).attr("i_type");
            	    		var useType = eval("this.now_Object.allItemProperty.useType."+i_type);
            	    		if(useType=="inputDiv"||useType=="textareaDiv")
            	    		{
            	    			var i_id;
            	    			if(useType=="textareaDiv")
            	    				i_id = $("#"+this.now_Object.mulSelectItemId[k]+ " textarea").attr("id");
            	    			if(useType=="inputDiv")
            	    				i_id = $("#"+this.now_Object.mulSelectItemId[k]+ " input").attr("id");
            	    			$("#"+this.now_Object.mulSelectItemId[k]).attr("i_x",Ext.getCmp(i_id).getPosition(true)[0]+diffX);
                        		$("#"+this.now_Object.mulSelectItemId[k]).attr("i_y",Ext.getCmp(i_id).getPosition(true)[1]+diffY);
                        		Ext.getCmp(i_id).setPosition(Ext.getCmp(i_id).getPosition(true)[0]+diffX,Ext.getCmp(i_id).getPosition(true)[1]+diffY); 
                        		$("#"+i_id).attr("i_x",Ext.getCmp(i_id).getPosition(true)[0]+diffX);
                        		$("#"+i_id).attr("i_y",Ext.getCmp(i_id).getPosition(true)[1]+diffY);
            	    		}
            	    		else if(useType=="noId")
            	    		{
            	    			var i_id = this.now_Object.mulSelectItemId[k];
            	    			$("#"+this.now_Object.mulSelectItemId[k]).attr("i_x",Ext.getCmp(i_id).getPosition(true)[0]+diffX);
                        		$("#"+this.now_Object.mulSelectItemId[k]).attr("i_y",Ext.getCmp(i_id).getPosition(true)[1]+diffY);
                        		Ext.getCmp(i_id).setPosition(Ext.getCmp(i_id).getPosition(true)[0]+diffX,Ext.getCmp(i_id).getPosition(true)[1]+diffY); 
            	    		}
            	    		else
            	    		{
            	    			var oobject = document.getElementById(this.now_Object.mulSelectItemId[k]);
            	    			var left_ = parseInt(oobject.style.left);
            		         	var top_ = parseInt(oobject.style.top);
            		         	var width_ = parseInt(oobject.style.width);
            		         	var height_ =  parseInt(oobject.style.height);
            		         	left_ += diffX;
            		         	top_ += diffY;
            		         	if(left_<=0) left_ = 0;
            		         	if(top_<=0) top_ = 0;
            		         	if(left_+width_>=this.maxLeft) left_ = this.maxLeft-width_;
            		         	if(top_+height_>=this.maxTop ) top_ = this.maxTop-height_;
            		         	oobject.style.left = left_ +'px';
            		         	oobject.style.top = top_ +'px';
            		         	var i_id = this.now_Object.mulSelectItemId[k];
            		         	$("#"+i_id).attr("i_x",left_);
                        		$("#"+i_id).attr("i_y",top_);
                        		if(useType=="ceateDivinput")
                        		{
                        			$("#"+i_id+" input").attr("i_x",left_);
                        			$("#"+i_id+" input").attr("i_y",top_);
                        		}
                        		if(useType=="ceateDivtextarea")
                        		{
                        			$("#"+i_id+" textarea").attr("i_x",left_);
                        			$("#"+i_id+" textarea").attr("i_y",top_);
                        		}
            	    		}
            	    	}
                    }
                    with (element.style) {
                    	var i_type = $("#"+element.id).attr("i_type");
                    	var useType = eval("this.now_Object.allItemProperty.useType."+i_type);
                    	if(useType=="inputDiv"||useType=="textareaDiv")
        	    		{
                    		$("#"+element.id).attr("i_width",elmW);
                    		$("#"+element.id).attr("i_height",elmH);
                    		$("#"+element.id).attr("i_x",elmX);
                    		$("#"+element.id).attr("i_y",elmY);
                    		if(useType=="textareaDiv")
        	    				i_id = $("#"+element.id+ " textarea").attr("id");
                    		if(useType=="inputDiv")
        	    				i_id = $("#"+element.id+ " input").attr("id");
                    		Ext.getCmp(i_id).setWidth(elmW);
                    		Ext.getCmp(i_id).setHeight(elmH);
                    		Ext.getCmp(i_id).setPosition(elmX,elmY);
                    		$("#"+i_id).attr("i_width",elmW);
                    		$("#"+i_id).attr("i_height",elmH);
                    		$("#"+i_id).attr("i_x",elmX);
                    		$("#"+i_id).attr("i_y",elmY);
        	    		}
                    	else if(useType=="noId")
                    	{
                    		$("#"+element.id).attr("i_width",elmW);
                    		$("#"+element.id).attr("i_height",elmH);
                    		$("#"+element.id).attr("i_x",elmX);
                    		$("#"+element.id).attr("i_y",elmY);
                    		var i_id = element.id;
                    		Ext.getCmp(i_id).setWidth(elmW);
                    		Ext.getCmp(i_id).setHeight(elmH);
                    		Ext.getCmp(i_id).setPosition(elmX,elmY);
                    	}
                    	else 
                    	{
	                        left = elmX + 'px';
	                        top = elmY + 'px';
	                        var i_id = element.id;
	                        if(i_type!="linex")
	                        {
		                        height = elmH + 'px';
		                        $("#"+i_id).attr("i_height",elmH);
	                        }
	                        else
	                        {
	                        	 $("#"+i_id).attr("i_height",parseInt(element.style.borderTopWidth));
	                        }
	                        if(i_type!="liney")
	                        {
	                        	width = elmW + 'px';
	                        	$("#"+i_id).attr("i_width",elmW);
	                        }
	                        else
	                        {
	                        	 $("#"+i_id).attr("i_width",parseInt(element.style.borderLeftWidth));
	                        }
                    		$("#"+i_id).attr("i_x",elmX);
                    		$("#"+i_id).attr("i_y",elmY);
                    		if(useType=="ceateDivinput")
                    		{
                    			$("#"+i_id+" input").attr("i_x",elmX);
                    			$("#"+i_id+" input").attr("i_y",elmY);
                    		}
                    		if(useType=="ceateDivtextarea")
                    		{
                    			$("#"+i_id+" textarea").attr("i_x",elmX);
                    			$("#"+i_id+" textarea").attr("i_y",elmY);
                    		}
                    	}
                    }
                    if (window.opera && document.documentElement) {
                        var oDF = document.getElementById('op-drag-fix');
                        if (!oDF) {
                            var oDF = document.createElement('input');
                            oDF.id = 'op-drag-fix';
                            oDF.style.display = 'none';
                            document.body.appendChild(oDF);
                        }
                        oDF.focus();
                    }
                    if (ondragmove) 
                        this.ondragmove(isResize);
                    cancelEvent(e);
                }
            };
            DragResize.prototype.mouseUp = function(e){
				//刚才是否有拖动。
				if(mourseMoveObject.isMourseDown){
					//内部滚动条
					var form_scroll =$("#biaodangsheji  .x-panel-body ");
					form_scroll = form_scroll.get(0);
					var scrollTop_ =  form_scroll.scrollTop;
					var scrollLeft_ = form_scroll.scrollLeft;
					
					var xx_mouse = e.pageX || e.clientX + document.documentElement.scrollLeft;
					var yy_mouse = e.pageY || e.clientY + document.documentElement.scrollTop;
					var x_temp = mourseMoveObject.xxsource < xx_mouse ? mourseMoveObject.xxsource:xx_mouse;
					var y_temp = mourseMoveObject.yysource < yy_mouse ? mourseMoveObject.yysource:yy_mouse;
					var x_temp1 = mourseMoveObject.xxsource > xx_mouse ? mourseMoveObject.xxsource:xx_mouse;
					var y_temp1 = mourseMoveObject.yysource > yy_mouse ? mourseMoveObject.yysource:yy_mouse;
					x_temp = x_temp-15+scrollLeft_;
					y_temp = y_temp -100+scrollTop_;
					x_temp1 = x_temp1-15+scrollLeft_;
					y_temp1 = y_temp1 - 100+scrollTop_;
					var k;
					var canSelectObjectIdArr;//有tab时
					if(this.now_Object.useFormTab.flag)//多个tab
					{
						var tabIndex = parseInt(Ext.getCmp("TabsPanel_cfz_pp").getActiveTab().tabIndexCfz)-1;
						canSelectObjectIdArr = this.now_Object.itemIdArrTab[tabIndex];
						//alert(this.now_Object.itemIdArrTab[tabIndex].length);
					}
					else
					{
						canSelectObjectIdArr = this.now_Object.itemIdArr;
					}
						for(k=0;k<canSelectObjectIdArr.length;k++)
	        	    	{
	        	    		//alert(this.now_Object.itemIdArr[k]);
	        	    		var myobjItem; //= document.getElemnt
	        	    		var a_width=0;
	        	    		var a_height=0;
	        	    		var useType = eval("this.now_Object.allItemProperty.useType."+this.now_Object.itemTypeArr[k]);
	        	    		switch(useType)
	        	    		{
	        	    			case "textareaDiv":
	        	    			case "inputDiv":
	        	    				a_width = Ext.getCmp(canSelectObjectIdArr[k]).getWidth();
	                	    		a_height =Ext.getCmp(canSelectObjectIdArr[k]).getHeight();
	        	    				myobjItem = $("#"+canSelectObjectIdArr[k]).parent();
	        	    				break;
	        	    			default:
	        	    				myobjItem = $("#"+canSelectObjectIdArr[k]);
	        	    				a_width = parseInt(myobjItem.css("width"));
	        	    				a_height = parseInt(myobjItem.css("height"));
	        	    				break;
	        	    		}
	        	    		var a_x = parseInt(myobjItem.css("left"));
	        	    		var a_y = parseInt(myobjItem.css("top"));
		        	    	var xxt = a_x+a_width;
		    	    		var yyt = a_y+a_height;
							//alert(a_x+":"+x_temp+","+a_y+":"+y_temp+","+xxt+":"+x_temp1+","+yyt+":"+y_temp1);
		        	    	if(mourseMoveObject.is_in_rec(a_x,a_y,a_x+a_width,a_y+a_height,x_temp,y_temp,x_temp1,y_temp1))
		        			{
		        	    		myobjItem = myobjItem.get(0);
		        				this.select(myobjItem,null,e);
		        			}
	        	    	}
					
        	    	
					var	div_cfz =  $("#aaaaaa");
					div_cfz.remove(); 
                	if(this.now_Object.linstenersFlag.afterSelectMulFlag == true&&this.now_Object.mulSelectItemId.length!=0)
                  		this.now_Object.linsteners.afterSelectMul(this.now_Object.mulSelectItemId);
				}
				mourseMoveObject.isMourseDown = false;




                with (this) {
                    if (!document.getElementById || !enabled) 
                        return;
                    var hRE = new RegExp(myName + '-([trmbl]{2})', '');
                    if (handle && ondragend) 
                        this.ondragend(hRE.test(handle.className));
                    deselect(false);
		
                }
            };
            DragResize.prototype.resizeHandleSet = function(elm, show){
                with (this) {
                    if (!elm._handle_tr) {
                        for (var h = 0; h < handles.length; h++) {
                            var hDiv = document.createElement('div');
                            hDiv.className = myName + ' ' + myName + '-' + handles[h];
                            elm['_handle_' + handles[h]] = elm.appendChild(hDiv);
                        }
                    }
                    for (var h = 0; h < handles.length; h++) {
                        elm['_handle_' + handles[h]].style.visibility = show ? 'inherit' : 'hidden';
                    }
                }
            };
            DragResize.prototype.resizeHandleDrag = function(diffX, diffY){
                with (this) {
                    var hClass = handle && handle.className && handle.className.match(new RegExp(myName + '-([tmblr]{2})')) ? RegExp.$1 : '';
                    var dY = diffY, dX = diffX, processed = false;
                    if (hClass.indexOf('t') >= 0) {
                        rs = 1;
                        if (elmH - dY < minHeight) 
                            mOffY = (dY - (diffY = elmH - minHeight));
                        else 
                            if (elmY + dY < minTop) 
                                mOffY = (dY - (diffY = minTop - elmY));
                        elmY += diffY;
                        elmH -= diffY;
                        processed = true;
                    }
                    if (hClass.indexOf('b') >= 0) {
                        rs = 1;
                        if (elmH + dY < minHeight) 
                            mOffY = (dY - (diffY = minHeight - elmH));
                        else 
                            if (elmY + elmH + dY > maxTop) 
                                mOffY = (dY - (diffY = maxTop - elmY - elmH));
                        elmH += diffY;
                        processed = true;
                    }
                    if (hClass.indexOf('l') >= 0) {
                        rs = 1;
                        if (elmW - dX < minWidth) 
                            mOffX = (dX - (diffX = elmW - minWidth));
                        else 
                            if (elmX + dX < minLeft) 
                                mOffX = (dX - (diffX = minLeft - elmX));
                        elmX += diffX;
                        elmW -= diffX;
                        processed = true;
                    }
                    if (hClass.indexOf('r') >= 0) {
                        rs = 1;
                        if (elmW + dX < minWidth) 
                            mOffX = (dX - (diffX = minWidth - elmW));
                        else 
                            if (elmX + elmW + dX > maxLeft) 
                                mOffX = (dX - (diffX = maxLeft - elmX - elmW));
                        elmW += diffX;
                        processed = true;
                    }
                    return processed;
                }
            };
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            //<![CDATA[
            
            // Using DragResize is simple!
            // You first declare a new DragResize() object, passing its own name and an object
            // whose keys constitute optional parameters/settings:
            
            var moveobjectcfz = new DragResize('dragresize', {
                minWidth: 2,
                minHeight: 2,
                minLeft: 1,
                minTop: 1,
                maxLeft: 9999,
                maxTop: 9999
            });
            
            // Optional settings/properties of the DragResize object are:
            // enabled: Toggle whether the object is active.
            // handles[]: An array of drag handles to use (see the .JS file).
            // minWidth, minHeight: Minimum size to which elements are resized (in pixels).
            // minLeft, maxLeft, minTop, maxTop: Bounding box (in pixels).
            
            // Next, you must define two functions, isElement and isHandle. These are passed
            // a given DOM element, and must "return true" if the element in question is a
            // draggable element or draggable handle. Here, I'm checking for the CSS classname
            // of the elements, but you have have any combination of conditions you like:
            
            moveobjectcfz.isElement = function(elm){
            	if (elm.className && elm.className.indexOf('drsElement') > -1) 
                {
            	     return true;
                }else if(elm.className && elm.className.indexOf('bcLineElement') > -1) 
                {
                    return true;
                }else if(elm.className && elm.className.indexOf('bcLineElementY') > -1)
                {
                	return true;
                }else if(elm.className && elm.className.indexOf('bbLineElement') > -1){
                	return true;
                }
            };
            moveobjectcfz.isHandle = function(elm){
            	 if (elm.className && elm.className.indexOf('drsElement') > -1) 
            	    {
            	        return true;
            	    }else if(elm.className && elm.className.indexOf('bcLineElement') > -1) 
            	    {
            	        return true;
            	    }else if(elm.className && elm.className.indexOf('bcLineElementY') > -1)
            	    {
            	    	return true;
            	    }else if(elm.className && elm.className.indexOf('bbLineElement') > -1){
            	    	return true;
            	    }
            };
            
            // You can define optional functions that are called as elements are dragged/resized.
            // Some are passed true if the source event was a resize, or false if it's a drag.
            // The focus/blur events are called as handles are added/removed from an object,
            // and the others are called as users drag, move and release the object's handles.
            // You might use these to examine the properties of the DragResize object to sync
            // other page elements, etc.
            
            moveobjectcfz.ondragfocus = function(){
            };
            moveobjectcfz.ondragstart = function(isResize){
            };
            moveobjectcfz.ondragmove = function(isResize){
            };
            moveobjectcfz.ondragend = function(isResize){this.now_Object.selectAndModifyComponent();
            };
            moveobjectcfz.ondragblur = function(){
            };
            
            // Finally, you must apply() your DragResize object to a DOM node; all children of this
            // node will then be made draggable. Here, I'm applying to the entire document.
            moveobjectcfz.apply(document);
            
            //]]>